home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / dodge.swf / scripts / __Packages / TeleportingEnemy.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  1.6 KB  |  65 lines

  1. class TeleportingEnemy extends Enemy
  2. {
  3.    var mc;
  4.    var targetCoords;
  5.    var tm;
  6.    var health;
  7.    static var SCORE = 200;
  8.    static var SHOTS = 3;
  9.    static var WAIT_TIME = 180;
  10.    static var ENEMY_TYPE = "enemy5";
  11.    static var MAX_HEALTH = 2;
  12.    static var COLOR = 16711935;
  13.    function TeleportingEnemy(x, y)
  14.    {
  15.       super(x,y);
  16.       this.mc._x = this.targetCoords.x;
  17.       this.mc._y = this.targetCoords.y;
  18.       this.mc.gotoAndPlay("teleport");
  19.    }
  20.    function getScore()
  21.    {
  22.       return TeleportingEnemy.SCORE;
  23.    }
  24.    function getEnemyType()
  25.    {
  26.       return TeleportingEnemy.ENEMY_TYPE;
  27.    }
  28.    function getWaitTime()
  29.    {
  30.       return TeleportingEnemy.WAIT_TIME;
  31.    }
  32.    function getMaxHealth()
  33.    {
  34.       return TeleportingEnemy.MAX_HEALTH;
  35.    }
  36.    function getColor()
  37.    {
  38.       return TeleportingEnemy.COLOR;
  39.    }
  40.    function createTrailManager()
  41.    {
  42.       this.tm = null;
  43.    }
  44.    function rotateToPlayer()
  45.    {
  46.       this.mc._rotation += 3;
  47.    }
  48.    function createNewMissile()
  49.    {
  50.       SoundManager.teleport();
  51.       var _loc3_ = 0;
  52.       while(_loc3_ < TeleportingEnemy.SHOTS)
  53.       {
  54.          new FastMissile(this.mc._x,this.mc._y,this.mc._rotation + _loc3_ * 120);
  55.          _loc3_ = _loc3_ + 1;
  56.       }
  57.       this.assignNewTarget();
  58.       this.mc._x = this.targetCoords.x;
  59.       this.mc._y = this.targetCoords.y;
  60.       this.mc.gotoAndPlay("teleport");
  61.       _root.attachMovie("blink","blink" + _root.getNextHighestDepth(),_root.getNextHighestDepth());
  62.       this.health = this.getMaxHealth();
  63.    }
  64. }
  65.